<template>
	<div>
		<el-radio-group v-model="labelPosition" size="small">

		</el-radio-group>
		<div style="margin: 20px;"></div>
		<el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign">

			<el-form-item label="类型Id">
				<el-input v-model="formLabelAlign.DictTypeId"></el-input>
			</el-form-item>
			<el-form-item label="状态">
				<el-input v-model="formLabelAlign.DictName"></el-input>
			</el-form-item>
			<el-form-item label="值">
				<el-input v-model="formLabelAlign.DictValue"></el-input>
			</el-form-item>
			<el-form-item label="信息">
				<el-input v-model="formLabelAlign.DictDesc"></el-input>
			</el-form-item>
			<el-form-item label="是否可用">
				<el-input v-model="formLabelAlign.IsDelete"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="onSubmit">立即修改</el-button>
				<el-button type="primary" @click="quxiao">取消</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	import Dictinfoapi from '@/api/DictinfoApi';

	export default {
		props: ['Id'],
		data() {
			return {
				labelPosition: 'right',
				formLabelAlign: {
					DictTypeId: '',
					DictName:'',
					DictValue:'',
					DictDesc:'',
					IsDelete: ''
				}
			};
		},
		methods: {
			onSubmit() {
				console.log(this.formLabelAlign)
				Dictinfoapi.Update(this.formLabelAlign).then(res => {
					if (res.code == 1) {
						console.log(res);
						this.$message({
							message: "修改成功",
							type: "success"
						})
						this.$emit('close')
					}

				})
			},
			quxiao() {
				this.$emit('close')
			}
		},
		created() {
			Dictinfoapi.get({Id:this.Id}).then(res => {
				console.log(this.Id);
				this.formLabelAlign = res.data;
			})
		}
	}
</script>

<style>
</style>